//
//  MLZPostsModel.m
//  MotherLover
//
//  Created by lanou on 16/1/9.
//  Copyright © 2016年 zj. All rights reserved.
//

#import "MLZPostsModel.h"

@implementation MLZPostsModel
- (instancetype)initWithObject:(BmobObject *)object{

    self = [super init];
    if (self)
    {
        self.objectId = [object objectForKey:@"objectId"];
        self.userName =[object objectForKey:@"userName"];
        NSDateFormatter *myFormat = [[NSDateFormatter alloc]init];
        [myFormat setDateFormat:@"yyyy年MM月dd日 hh:mm:ss"];
        //需要赋给一个时区
        NSTimeZone *myZone = [[NSTimeZone alloc]initWithName:@"GMT"];
        [myFormat setTimeZone:myZone];
        NSString *myString1 = [myFormat stringFromDate:[object.updatedAt dateByAddingTimeInterval:28800]];
       self.updatedAt= myString1 ;
        self.title= [object objectForKey:@"title"];
        self.contents = [object objectForKey:@"contents"];
        self.picture = [object objectForKey:@"picture"];
        
        
      // BmobFile *infoImageFile = [obj objectForKey:@"infoImage"];
        //self.infoImage = infoImageFile.url;
       
       
        
       // BmobFile *infoTitleImageFile = [obj objectForKey:@"infoTitleImage"];
        //self.infoTitleImage = infoTitleImageFile.url;
            }
    return self;





}


@end
